Patent Document 1 discloses a heterocyclic compound having an excellent CH24H inhibitory action, which is useful as an agent for the prophylaxis or treatment of neurodegenerative diseases (e.g., Alzheimer's disease, mild cognitive disorder, Huntington's disease, Parkinson's disease, amyotrophic lateral sclerosis, traumatic brain injury, cerebral infarction, glaucoma, multiple sclerosis and the like), epilepsy, schizophrenia and the like.